/*
 * Dijjer - A Peer to Peer HTTP Cache
 * Copyright (C) 2004,2005 Change.Tv, Inc
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

package dijjer.io.store;

import dijjer.util.VeryLongInteger;

public class Block {

	public static final String VERSION = "$Id: Block.java 2 2008-03-21 14:33:03Z ian.clarke $";

	private int _recordNumber;
	private long _lastAccessTime;
	private VeryLongInteger _key;

	public Block(int recordNum, VeryLongInteger key, long accessTime) {
		_recordNumber = recordNum;
		_key = key;
		_lastAccessTime = accessTime;
	}

	public int getRecordNumber() {
		return _recordNumber;
	}

	public void setRecordNumber(int newRecNo) {
		_recordNumber = newRecNo;
	}

	public VeryLongInteger getKey() {
		return _key;
	}

	public long lastAccessTime() {
		return _lastAccessTime;
	}

	public String toString() {
		return "key: " + _key + " lastAccess: " + _lastAccessTime + " rec: " + _recordNumber;
	}

	public long getLastAccessTime() {
		return _lastAccessTime;
	}

	public void setLastAccessTime(long accessTime) {
		_lastAccessTime = accessTime;
	}
	
	public void setKey(VeryLongInteger key) {
		_key = key;
	}

}
